package com.cjx.minio.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 *@Author cjunxian
 * @date 2020/09/25 09:15:16
 * @doc minio客户端初始化
 * @version 1.0.0
 */
@Configuration
public class MinioConfig {

  @Value("${minio.endpoint}")
  private String ENDPOINT;

  @Value("${minio.accessKey}")
  private String ACCESS_KEY;

  @Value("${minio.secretKey}")
  private String SECRET_KEY;

  @Bean
  public MinioClient minioClient() {
    return MinioClient.builder().endpoint(ENDPOINT).credentials(ACCESS_KEY, SECRET_KEY).build();
  }
}
